home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Interactive Web Graphics with Shout 3D
/
Interactive Web Graphics With Shout 3D.iso
/
mac
/
Shout3Ddemo
/
Shout3d_runtime
/
codebase
/
custom_nodes
/
SimpleInline.java
< prev
next >
Wrap
Text File
|
2000-09-21
|
1KB
|
59 lines
/**
Company: Eyematic Interfaces
Project: Shout3D 2.0 Sample Code
Class: Inline
Date: September 21, 2000
Description: Simple VRML style Inline node.
(C) Copyright Eyematic Interfaces, Inc. - 1997-2000 - All rights reserved
*/
package custom_nodes;
import shout3d.core.*;
/**
* SimpleInline.
*
* @author Paul Isaacs
*/
public class SimpleInline extends Transform implements FieldObserver {
/**
* url field. This should be a string denoting a path to the .s3d file, relative to
* the codebase directory.
*/
final public StringArrayField url = new StringArrayField(this, "url", Field.ANY, null);
/**
* Constructs a default SimpleInline
*/
public SimpleInline(){
url.addFieldObserver(this, null);
}
protected void finalize() throws Throwable {
url.removeFieldObserver(this);
super.finalize();
}
/**
*
* Subclasses must call this from within their own onFieldChange() method.
*
*/
public void onFieldChange(Field theField, Object userData) {
if ( theField == url ){
// can't load a scene unless you've got a viewer.
if (getViewer() != null ){
getViewer().loadURL(url.getValue(), this);
}
}
else {
// Call the super class, it's not a field this node cares about.
super.onFieldChange(theField, userData);
}
}
}